#ifndef _GET_THREAD_ID_H_
#define _GET_THREAD_ID_H_

#ifdef WIN32
  #include <Windows.h>
  #define gettid2()     GetCurrentThreadId()
#elif __ANDROID__
  #include "unistd.h"
  #define gettid2()		gettid()
#elif defined(__IOS__) || defined(__MAC__) || defined(__APPLE__)
  #include <unistd.h>
  #include <sys/syscall.h>
  #define gettid2()     syscall(SYS_thread_selfid)
#else
  #include <unistd.h>
  #include <sys/syscall.h>
  #include <stdio.h>
  #define gettid2()     syscall(SYS_gettid)
#endif

#endif

